namespace :db do
  desc "Drop existing stored procedures using names from db/procedures"
  task :drop_procedures => :environment do
    require File.join(RAILS_ROOT, "vendor", "plugins", "mysql_stored_procs", "lib", "mysql_stored_procs")
    MysqlStoredProcs.delete_procs
  end

  desc "Create stored procedures from db/procedures"
  task :create_procedures => :environment do
    require File.join(RAILS_ROOT, "vendor", "plugins", "mysql_stored_procs", "lib", "mysql_stored_procs")
    MysqlStoredProcs.add_procs
  end

  desc "Reinitialize stored procedures from db/procedures"
  task :refresh_procedures => :environment do
    require File.join(RAILS_ROOT, "vendor", "plugins", "mysql_stored_procs", "lib", "mysql_stored_procs")
    MysqlStoredProcs.reinitialize_procs
  end
end